<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
<head>
    <%--  这一行删除了一行报错不可以有错--%>
    <!-- 指定字符集 -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>修改用户</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!--<script src="js/jquery-2.1.0.min.js"></script>
    <script src="js/bootstrap.min.js"></script>-->

</head>
<body>
<hr>
${update}
<hr>

<div class="container" style="width: 400px;">
    <h3 style="text-align: center;">修改联系人</h3>
    <form action="UserServlet" method="post" enctype="multipart/form-data">
        <%--        隐藏域放被修改用户的id--%>
        <input type="hidden" name="id" value="${update.id}">
        <%--        隐藏域放被修改用户的action--%>
        <input type="hidden" name="action" value="update">
        <div class="form-group">
            <label for="name">姓名：</label>
            <input type="text" class="form-control" id="name" name="name" readonly="readonly" placeholder="请输入姓名"
                   value="${update.name}"/>
        </div>

        <div class="form-group">
            <label>性别：</label>
            <input type="radio" name="sex" value="男"
                   <c:if test="${update.sex == '男'}">checked</c:if> />男
            <input type="radio" name="sex" value="女"
                   <c:if test="${update.sex == '女'}">checked</c:if> />女
        </div>

        <div class="form-group">
            <label for="age">年龄：</label>
            <input type="text" class="form-control" id="age" name="age" placeholder="请输入年龄" value="${update.age}"/>
        </div>

        <div class="form-group">
            <label for="address">籍贯：</label>
            <select id="address" name="address" class="form-control">
                <option value="广东" <c:if test="${update.address == '广东'}">selected</c:if>>广东</option>
                <option value="广西" <c:if test="${update.address == '广西'}">selected</c:if>>广西</option>
                <option value="湖南" <c:if test="${update.address == '湖南'}">selected</c:if>>湖南</option>
            </select>
        </div>

        <div class="form-group">
            <label for="qq">QQ：</label>
            <input id="qq" type="text" class="form-control" name="qq" placeholder="请输入QQ号码" value="${update.qq}"/>
        </div>

        <div class="form-group">
            <label for="email">Email：</label>
            <input id="email" type="text" class="form-control" name="email" placeholder="请输入邮箱地址"
                   value="${update.email}"/>
        </div>
            <img width="100" src="${update.pic}" alt="修改头像">
        <div class="form-group">
            <label for="pic">头像：</label>
            <input id="pic" type="file" class="form-control" name="pic"/>
        </div>

        <div class="form-group" style="text-align: center">
            <input class="btn btn-primary" type="submit" value="提交"/>
            <input class="btn btn-default" type="reset" value="重置"/>
            <input class="btn btn-default" type="button" value="返回"/>
        </div>
    </form>
</div>
</body>
</html>